public class HomeWork09_06{
    public static void main(String[] args){
        DaffodilNumb dn = new DaffodilNumb();
        
        for(int i = 100; i < 1000; i++){
            if(dn.isDaffodilNumb(i)){
                System.out.println(i);
            }
        }
    }
}

class DaffodilNumb{
    public boolean isDaffodilNumb(int itger){
        int backUp = itger;
        int a = (int)Math.pow(itger / 100, 2);
        itger %= 100;
        int b = (int)Math.pow(itger / 10, 2);
        int c = (int)Math.pow(itger % 10, 2);
        if(a + b + c == itger){
            return true;
        }
        return false;
    }
}